using System;

using Insesoft.Entities;

namespace InseSoft.UIControllers
{
    public class ApplicationSession
    {
        private ApplicationSession(){}

        private static ApplicationSession instance;

        public Usuario Usuario { get; set; }
        public Empresa Empresa { get; set; }
        public TipoCambio TipoCambio { get; set; }
        public DateTime Hoy { get; set; }
        
        public static ApplicationSession Instance
        {
            get { return instance ?? (instance = new ApplicationSession()); }
        }

        public static void Clear()
        {
            Instance.Empresa = Empresa.EmptyInstance;
            Instance.Usuario = Usuario.EmptyInstance;
            Instance.TipoCambio = TipoCambio.EmptyInstance;
            Instance.Hoy = DateTime.MinValue;
        }
    }
}